home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5653 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.8 KB  |  70 lines

  1. Path: citr.uq.oz.au!usenet
  2. From: martin@cooloola.citr.uq.oz.au (Martin Pool)
  3. Newsgroups: comp.lang.c++
  4. Subject: Old Fortran dog learning new Visual C++ tricks - some questions [re: 1]
  5. Date: 06 Feb 1996 04:25:42 GMT
  6. Organization: CiTR
  7. Message-ID: <MARTIN.96Feb6142542@cooloola.citr.uq.oz.au>
  8. References: <4en04g$5nv@news-2.csn.net>
  9. NNTP-Posting-Host: cooloola.citr.uq.oz.au
  10. In-reply-to: charles stoyer's message of 31 Jan 1996 05:53:20 GMT
  11.  
  12. In article <4en04g$5nv@news-2.csn.net> charles stoyer <cstoyer@support.interpex.com> writes:
  13.  
  14. Isn't the Developer Studio gorgeous!  I thought nothing would beat emacs for
  15. coding, but this comes pretty close.  It's different, and not as good in some
  16. areas, but great in its own way.
  17.  
  18. > 1. What is a .PCH file and what is it for? It is huge (4Mb) 
  19. > even for small programs and exists in both the Release and 
  20. > Debug directories. I can't find any reference to it in the 
  21. > documentation. Do I need it and can I turn it off?
  22.  
  23. A PCH is a Pre-Compiled Header.  Roughly speaking, the idea is to save you from
  24. recompiling the (huge) Windows header files each time you compile a file which
  25. uses them.  After reading your source the first time, the compiler spits out a
  26. pre-digested version of the headers.
  27.  
  28. I think you can control this from somewhere in the 'Build/Settings' dialog.
  29.  
  30. You don't _need_ it, but I wouldn't be without it.  On my machine (486, 48megs
  31. of ram) it cuts ~50 seconds off the build time.  To me, 4megs of disk sounds
  32. like a pretty good price to pay.
  33.  
  34. > 2. You can't call an item which expects a string or string 
  35. > pointer with a Cstring argument. Is there some way to copy to 
  36. > or recast as a Cstring to a string or string pointer?
  37.  
  38. CString (note caps) defines operator const char * which will allow you to
  39. convert it to a char *.  This is of course a const pointer, as it points into
  40. memory allocated by the CString.  Read the docs for other caveats about using
  41. this pointer.  In short, you can say
  42.  
  43.     char szBuf[500];
  44.     CString strFoo;
  45.     char *pszFoo;
  46.  
  47.     strFoo = "Green Day Concert";    // assign from char *
  48.     pszFoo = strFoo;                // convert to const char *
  49.     strcpy (szBuf, (const char *) strFoo); // similarly
  50.  
  51. > 5. It looks like radio buttons are treated in a "dumb" fashion 
  52. > by the dialog resource editor and the AppWizard. It seems that 
  53. > it is the application's responsibility to see that one button 
  54. > is turned on and turn the others off before updating data. Is 
  55. > that right?
  56.  
  57. I don't think so.  Check out CCmdUI::SetRadio().
  58.  
  59. /\/\----
  60.     Martin Pool
  61.     BE(Computer Systems) Yr 3, University of Queensland
  62.     http://student.uq.edu.au/~e4329203
  63.  
  64.     C, C++, Windows, Unix proto-guru
  65.  
  66.     "[Walt Disney] wanted to have a dress code for his community, and a
  67.     behaviour code: residents could be evicted for being drunk in public or
  68.     cohabiting before marriage.  He would outlaw, amongst other things,
  69.     pets, unemployment, and voting."  [New Scientist 20 Jan 96 pg 36]
  70.